package sectorCrack.utils;

import java.text.SimpleDateFormat;
import java.util.TimeZone;

public class GeneralUtils {

	public static SimpleDateFormat getDateFormatter() {
		SimpleDateFormat utcFormatter = new SimpleDateFormat();
		utcFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
		return utcFormatter;
	}

	public static SimpleDateFormat getDateFormatter(String format) {
		SimpleDateFormat utcFormatter = new SimpleDateFormat(format);
		utcFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
		return utcFormatter;
	}

	/**
	 * remove [a-zA-Z], and remove double spacing
	 * 
	 * @param line
	 * @return
	 */
	public static String removeLetters(String line) {
		line = line.replace("NA", "-999");
		String result;
		result = line.replaceAll("[a-zA-z]", "");
		while (result.contains("  ")) {
			result = result.replace("  ", " ");
		}
		return result;
	}

}
